home *** CD-ROM | disk | FTP | other *** search
/ Champak 132 (Alt) / Vol 132.iso / games / 3d_hyper / 3d_hyper.dcr / Scripts_25_Place Behavior.ls < prev    next >
Encoding:
Text File  |  2011-06-09  |  570 b   |  28 lines

  1. global gRacers
  2.  
  3. on beginSprite me
  4.   playerTime = gRacers[1].pCourseTime
  5.   playerPlace = 1
  6.   repeat with i = 2 to gRacers.count
  7.     if gRacers[i].pCourseTime then
  8.       if gRacers[i].pCourseTime < playerTime then
  9.         playerPlace = playerPlace + 1
  10.       end if
  11.     end if
  12.   end repeat
  13.   if playerPlace = 1 then
  14.     theText = "1st"
  15.   else
  16.     if playerPlace = 2 then
  17.       theText = "2nd"
  18.     else
  19.       if playerPlace = 3 then
  20.         theText = "3rd"
  21.       else
  22.         theText = "4th"
  23.       end if
  24.     end if
  25.   end if
  26.   sprite(me.spriteNum).member.text = theText
  27. end
  28.